home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / quicktime / streaming / qtspacketizerreassembler / imaaudiortp / headers / imaaudioqueue.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  1.9 KB  |  100 lines

  1. /*
  2.     File:        IMAAudioQueue.h
  3.  
  4.     Contains:    Delcaration of IMAAudioQueue, a queue datatype for IMA
  5.                 audio sample data.
  6.     
  7.     Copyright:    © 1997-1999 by Apple Computer, Inc., all rights reserved.
  8.  
  9.     
  10.     
  11.     The IMAAudioQueue serves several functions:
  12.     
  13.         -    it internally copies and disposes of RTPMPSampleDataParams
  14.             data structures
  15.         
  16.         -    it converts from the descriptions of arbitrarily large sample
  17.             blocks, given in RTPMPSampleDataParams data structures, to
  18.             descriptions of single frames
  19.         
  20.         -    it can convert incoming data to a lower sample rate by dropping
  21.             frames as necessary
  22.     
  23. */
  24.  
  25.  
  26.  
  27. #ifndef __IMAAUDIOQUEUE__
  28. #define __IMAAUDIOQUEUE__
  29.  
  30. #pragma once
  31.  
  32.  
  33.  
  34. #include "TQueue.h"
  35. #include <QTStreamingComponents.h>
  36.  
  37.  
  38.  
  39. typedef struct IMAAudioQueueElement
  40. {
  41.     TimeValue64                    itsTimestamp;
  42.     UInt32                        itsChannel;
  43.     RTPMPSampleDataParams *        itsSampleDataParams;
  44.     UInt32                        itsOffset;
  45. } IMAAudioQueueElement;
  46.  
  47. typedef struct IMAAudioQueue
  48. {
  49.     TQueue            __itsQueue;
  50.     TimeValue64        __itsStartTime;
  51.     UInt32            __itsFrameCount;
  52.     UInt32            __itsCurrentOffset;
  53.     UInt32            __itsConsumedFrameCount;
  54.     UInt32            __itsDequeuedFrameCount;
  55.     UnsignedFixed    __itsIncomingSampleRate;
  56.     UnsignedFixed    __itsOutgoingSampleRate;
  57.     UInt16            __itsChannelCount;
  58. } IMAAudioQueue;
  59.  
  60.  
  61.  
  62. extern
  63. void
  64. IMAAudioQueueInitialize(
  65.     IMAAudioQueue *        inQueue );
  66.  
  67. extern
  68. UnsignedFixed
  69. IMAAudioQueueSetFlowControl(
  70.     IMAAudioQueue *        inQueue,
  71.     UnsignedFixed        inIncomingSampleRate,
  72.     UnsignedFixed        inOutgoingSampleRate,
  73.     UInt16                inChannelCount );
  74.  
  75. extern
  76. UInt32
  77. IMAAudioQueueCount(
  78.     const IMAAudioQueue *    inQueue );
  79.  
  80. extern
  81. RTPMPSampleDataParams *
  82. IMAAudioQueueEnqueue(
  83.     IMAAudioQueue *                    inQueue,
  84.     const RTPMPSampleDataParams *    inSampleDataParams );
  85.  
  86. extern
  87. Boolean
  88. IMAAudioQueueDequeue(
  89.     IMAAudioQueue *            inQueue,
  90.     IMAAudioQueueElement *    outElement );
  91.  
  92. extern
  93. void
  94. IMAAudioQueueFlush(
  95.     IMAAudioQueue *        inQueue );
  96.  
  97.  
  98.  
  99. #endif /* __IMAAUDIOQUEUE__ */
  100.